package com.wing.productionPlan.model.response;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.wing.productionPlan.model.entity.SimpleWorkOrder;
import com.wing.productionPlan.utils.ExcelExport;
import com.wing.web.excel.ExcelIn;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 简版工单表VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class SimpleWorkOrderVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @ExcelExport(value = "创建时间", sort = 7)
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    @ExcelExport(value = "添加人", sort = 6)
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * day
     */
    private Integer day;

    /**
     * no
     */
    private Integer no;

    /**
     * 工单编号
     */
    @ExcelExport(value = "工单编号", sort = 1)
    private String code;

    /**
     * 企业编号
     */
    private String enterpriseCode;

    /**
     * 设备编号
     */
    private String deviceCode;
    /**
     * 工序id
     */
    private Long processId;
    /**
     * 工序名称
     */
    private String nodeNames;
    /**
     * 工单计划编号
     */
    @ExcelExport(value = "工单计划编号", sort = 2)
    private String workPlanCode;
    /**
     * 产品编号
     */
    @ExcelExport(value = "生产产品编号", sort = 2)
    private String skuCode;
    /**
     * 生产数量
     */
    @ExcelExport(value = "生产数量", sort = 3)
    private Integer productionQuantity;
    /**
     * 生产设备
     */
    @ExcelExport(value = "生产设备数量", sort = 4)
    private Integer deviceQuantity;
    private String remark;
    /**
     * 关联设备
     */
    private List<SimpleWorkOrderDeviceVO> deviceVOList;
    /**
     * 关联设备
     */
    private List<ProductionProcessMaterialVO> MaterialVOList;

    private String processName;

    private List<SimpleWorkOrderProcessVO> processVOList;

    /**
     * 状态
     */
    @ExcelExport(value = "状态",sort = 5,kv = "not-未完结;end-完结;start-开工")
    private SimpleWorkOrder.Status status;

    /**
     * 状态描述
     */
    @TableField(exist = false)
    private String statusDesc;

    public String getStatusDesc() {
        return status == null ? null : status.getDesc();
    }

    private String unitName;

}
